package com.starlink.client.jd.request.base;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Contact implements Serializable {
    /**
     * 寄件人姓名；长度1-50，超出字段长度报错；不支持生僻字及emjio
     */
    private String name;
    /**
     * 寄件人手机号码；长度11个字符，超出字段长度报错；最多仅支持传入1个手机号
     */
    private String mobile;
    /**
     * 寄件全地址；长度1-200字符，超出字段长度报错；必须包含省市
     */
    private String fullAddress;
    /**
     * 发货仓编码；长度1-50字符；用于匹配揽收站点，入参传入此信息时，优先以此获取揽收站点，本信息可通过销售或销售支持获取
     */
    private String warehouseCode;

    /**
     * 模型转换
     *
     * @return
     */
    public com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.Contact toJdPreCreate() {
        com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.Contact contact = new com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.Contact();
        contact.setName(this.name);
        contact.setMobile(this.mobile);
        contact.setFullAddress(this.fullAddress);
        contact.setWarehouseCode(this.warehouseCode);
        return contact;
    }

    /**
     * 模型转换
     *
     * @return
     */
    public com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.Contact toJdCreate() {
        com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.Contact contact =
                new com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.Contact();
        contact.setName(this.name);
        contact.setMobile(this.mobile);
        contact.setFullAddress(this.fullAddress);
        contact.setWarehouseCode(this.warehouseCode);
        return contact;
    }

    public com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonModifyOrderV1.Contact toJdModify() {
        com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonModifyOrderV1.Contact contact =
                new com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonModifyOrderV1.Contact();
        contact.setName(this.name);
        contact.setMobile(this.mobile);
        contact.setFullAddress(this.fullAddress);
        contact.setWarehouseCode(this.warehouseCode);
        return contact;
    }

}
